/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package geradorentidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import br.com.slw.entidades.indicadores.SlwTipoNotificacao;

/**
 *
 * @author Familia
 */
@Entity
@Table(name = "slw_notificacao")
@NamedQueries({
    @NamedQuery(name = "SlwNotificacao.findAll", query = "SELECT s FROM SlwNotificacao s"),
    @NamedQuery(name = "SlwNotificacao.findByIdNotificacao", query = "SELECT s FROM SlwNotificacao s WHERE s.idNotificacao = :idNotificacao"),
    @NamedQuery(name = "SlwNotificacao.findByPeridiocidade", query = "SELECT s FROM SlwNotificacao s WHERE s.peridiocidade = :peridiocidade"),
    @NamedQuery(name = "SlwNotificacao.findByDatInicial", query = "SELECT s FROM SlwNotificacao s WHERE s.datInicial = :datInicial"),
    @NamedQuery(name = "SlwNotificacao.findByDatFinal", query = "SELECT s FROM SlwNotificacao s WHERE s.datFinal = :datFinal"),
    @NamedQuery(name = "SlwNotificacao.findByHorario", query = "SELECT s FROM SlwNotificacao s WHERE s.horario = :horario")})
public class SlwNotificacao implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_NOTIFICACAO")
    private Long idNotificacao;
    @Basic(optional = false)
    @Column(name = "PERIDIOCIDADE")
    private char peridiocidade;
    @Basic(optional = false)
    @Column(name = "DAT_INICIAL")
    @Temporal(TemporalType.DATE)
    private Date datInicial;
    @Column(name = "DAT_FINAL")
    @Temporal(TemporalType.DATE)
    private Date datFinal;
    @Column(name = "HORARIO")
    @Temporal(TemporalType.TIME)
    private Date horario;
    @JoinColumn(name = "ID_ITEM", referencedColumnName = "ID_ITEM")
    @ManyToOne(optional = false)
    private SlwItem slwItem;
    @JoinColumn(name = "TIPO_NOTIFICACAO", referencedColumnName = "COD_TIPO_NOTIFICACAO")
    @ManyToOne(optional = false)
    private SlwTipoNotificacao slwTipoNotificacao;
    @JoinColumn(name = "USUARIO", referencedColumnName = "ID_USUARIO")
    @ManyToOne(optional = false)
    private SlwUsuario slwUsuario;

    public SlwNotificacao() {
    }

    public SlwNotificacao(Long idNotificacao) {
        this.idNotificacao = idNotificacao;
    }

    public SlwNotificacao(Long idNotificacao, char peridiocidade, Date datInicial) {
        this.idNotificacao = idNotificacao;
        this.peridiocidade = peridiocidade;
        this.datInicial = datInicial;
    }

    public Long getIdNotificacao() {
        return idNotificacao;
    }

    public void setIdNotificacao(Long idNotificacao) {
        this.idNotificacao = idNotificacao;
    }

    public char getPeridiocidade() {
        return peridiocidade;
    }

    public void setPeridiocidade(char peridiocidade) {
        this.peridiocidade = peridiocidade;
    }

    public Date getDatInicial() {
        return datInicial;
    }

    public void setDatInicial(Date datInicial) {
        this.datInicial = datInicial;
    }

    public Date getDatFinal() {
        return datFinal;
    }

    public void setDatFinal(Date datFinal) {
        this.datFinal = datFinal;
    }

    public Date getHorario() {
        return horario;
    }

    public void setHorario(Date horario) {
        this.horario = horario;
    }

    public SlwItem getSlwItem() {
        return slwItem;
    }

    public void setSlwItem(SlwItem slwItem) {
        this.slwItem = slwItem;
    }

    public SlwTipoNotificacao getSlwTipoNotificacao() {
        return slwTipoNotificacao;
    }

    public void setSlwTipoNotificacao(SlwTipoNotificacao slwTipoNotificacao) {
        this.slwTipoNotificacao = slwTipoNotificacao;
    }

    public SlwUsuario getSlwUsuario() {
        return slwUsuario;
    }

    public void setSlwUsuario(SlwUsuario slwUsuario) {
        this.slwUsuario = slwUsuario;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idNotificacao != null ? idNotificacao.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SlwNotificacao)) {
            return false;
        }
        SlwNotificacao other = (SlwNotificacao) object;
        if ((this.idNotificacao == null && other.idNotificacao != null) || (this.idNotificacao != null && !this.idNotificacao.equals(other.idNotificacao))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "geradorentidades.SlwNotificacao[idNotificacao=" + idNotificacao + "]";
    }

}
